#ifndef _TCP_TYPES_H_
#define _TCP_TYPES_H_

typedef union _UDouble {
    double d;
    unsigned char c[8];
} UDouble;


struct Cmd
{
    Cmd() :
        head(1212),
        size(266),
        enable(0),
        ec(0),
        MODE(1),
        FT_MODE(0),
        moving_trigger(0),
        PERIOD_MODE(0),
        period(40),
        weight_tool(0),
        x_size(0),
        y_size(0),
        z_size(0),
        q1(0.329),
        q2(0.919),
        q3(0.165),
        q4(-2.350),
        q5(-0.199),
        q6(1.408),
        q7(-0.069),
        x2(0.550),
        y2(0.200),
        z2(0.200),
        rx2(0),
        ry2(0),
        rz2(0),
        elbow2(-0.100),
        kx(500),
        ky(500),
        kz(500),
        krx(30),
        kry(30),
        krz(30),
        cx(500),
        cy(500),
        cz(500),
        crx(30),
        cry(30),
        crz(30),
        end(3434)
    {}


    quint16 head;
    quint16 size;
    quint16 enable;
    quint16 ec;
    quint16 MODE;
    quint16 FT_MODE;
    quint16 moving_trigger;
    quint16 PERIOD_MODE;
    double  period;
    double  weight_tool;
    double  x_size;
    double  y_size;
    double  z_size;
    double  q1;
    double  q2;
    double  q3;
    double  q4;
    double  q5;
    double  q6;
    double  q7;
    double  x2;
    double  y2;
    double  z2;
    double  rx2;
    double  ry2;
    double  rz2;
    double  elbow2;
    double  kx;
    double  ky;
    double  kz;
    double  krx;
    double  kry;
    double  krz;
    double  cx;
    double  cy;
    double  cz;
    double  crx;
    double  cry;
    double  crz;
    quint16 end;
    quint16 reserve[3];
};


struct MsgRecv
{
    double q1;
    double q2;
    double q3;
    double q4;
    double q5;
    double q6;
    double q7;
    double x;
    double y;
    double z;
    double rx;
    double ry;
    double rz;
    double elbow;
    double FT1;
    double FT2;
    double FT3;
    double FT4;
    double FT5;
    double FT6;
};

struct MsgRecv1
{
    quint16 jState1;
    quint16 jState2;
    quint16 jState3;
    quint16 jState4;
    quint16 jState5;
    quint16 jState6;
    quint16 jState7;
    quint16 Enable;
    quint16 errorClean;
    quint16 controlMode;
    quint16 ftMode;
    quint16 triggerSignal;
    quint16 periodMode;
};

struct MsgRecv2
{
    double periodValue;
    double toolmass;
    double toolComX;
    double toolComY;
    double toolComZ;
    double qTarget1;
    double qTarget2;
    double qTarget3;
    double qTarget4;
    double qTarget5;
    double qTarget6;
    double qTarget7;
    double xTarget;
    double yTarget;
    double zTarget;
    double rxTarget;
    double ryTarget;
    double rzTarget;
    double elbowTarget;
    double kx;
    double ky;
    double kz;
    double krx;
    double kry;
    double krz;
    double cx;
    double cy;
    double cz;
    double crx;
    double cry;
    double crz;
};

#endif
